<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://localhost" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://localhost" elementFormDefault="qualified">
  <xs:element name="report">
    <xs:annotation>
      <xs:documentation xml:lang="ro">Raportare pentru PNS la nivel judeţean</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name="facturi" minOccurs="0">
          <xs:annotation>
            <xs:documentation xml:lang="ro">Lista de facturi raportate</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="factura" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                  <xs:documentation xml:lang="ro">Factura raportata</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="articol" maxOccurs="unbounded">
                      <xs:annotation>
                        <xs:documentation xml:lang="ro">Articol factură</xs:documentation>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:attribute name="code" type="xs:string" use="required">
                          <xs:annotation>
                            <xs:documentation xml:lang="ro">Codul articolului (valoare din nomenclatorul corespunzător tipuli de mai jos)</xs:documentation>
                          </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="articleType" use="required">
                          <xs:annotation>
                            <xs:documentation xml:lang="ro">Tipul de articol facturat</xs:documentation>
                          </xs:annotation>
                          <xs:simpleType>
                            <xs:restriction base="xs:string">
                              <xs:enumeration value="DRG">
                                <xs:annotation>
                                  <xs:documentation xml:lang="en">Drug</xs:documentation>
                                  <xs:documentation xml:lang="ro">Medicament</xs:documentation>
                                </xs:annotation>
                              </xs:enumeration>
                              <xs:enumeration value="GDS">
                                <xs:annotation>
                                  <xs:documentation xml:lang="en">Sanitar material</xs:documentation>
                                  <xs:documentation xml:lang="ro">Material sanitar</xs:documentation>
                                </xs:annotation>
                              </xs:enumeration>
                              <xs:enumeration value="MDT">
                                <xs:annotation>
                                  <xs:documentation xml:lang="en">Medical test</xs:documentation>
                                  <xs:documentation xml:lang="ro">Test medical</xs:documentation>
                                </xs:annotation>
                              </xs:enumeration>
                              <xs:enumeration value="MDD">
                                <xs:annotation>
                                  <xs:documentation xml:lang="en">Medical device</xs:documentation>
                                  <xs:documentation xml:lang="ro">Instrument medical</xs:documentation>
                                </xs:annotation>
                              </xs:enumeration>
                            </xs:restriction>
                          </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="qty" type="xs:decimal" use="required">
                          <xs:annotation>
                            <xs:documentation xml:lang="ro">Cantitate facturată</xs:documentation>
                          </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="vat" type="xs:double" use="required">
                          <xs:annotation>
                            <xs:documentation xml:lang="ro">Procent TVA</xs:documentation>
                          </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="vatValue" type="xs:double" use="required">
                          <xs:annotation>
                            <xs:documentation xml:lang="ro">Valoarea TVA</xs:documentation>
                          </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="totalValueWOTVA" type="xs:double" use="required">
                          <xs:annotation>
                            <xs:documentation xml:lang="ro">Valoare fără TVA</xs:documentation>
                          </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="totalValue" type="xs:double" use="required">
                          <xs:annotation>
                            <xs:documentation xml:lang="ro">Valoare totală</xs:documentation>
                          </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="unitPrice" type="xs:double" use="required">
                          <xs:annotation>
                            <xs:documentation xml:lang="ro">Preţ unitar</xs:documentation>
                          </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="appID" type="xs:unsignedLong" use="required">
                          <xs:annotation>
                            <xs:documentation xml:lang="ro">Identificatorul unic al înregistrării</xs:documentation>
                          </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="allocationType" use="required">
                          <xs:annotation>
                            <xs:documentation xml:lang="ro"> Modul de distributie a valorii articolelor</xs:documentation>
                          </xs:annotation>
                          <xs:simpleType>
                            <xs:restriction base="xs:string">
                              <xs:enumeration value="0">
                                <xs:annotation>
                                  <xs:documentation xml:lang="ro">PNS nedefalcat</xs:documentation>
                                </xs:annotation>
                              </xs:enumeration>
                              <xs:enumeration value="1">
                                <xs:annotation>
                                  <xs:documentation xml:lang="ro">1-Spital</xs:documentation>
                                </xs:annotation>
                              </xs:enumeration>
                              <xs:enumeration value="2">
                                <xs:annotation>
                                  <xs:documentation xml:lang="ro">2-Ambulatoriu</xs:documentation>
                                </xs:annotation>
                              </xs:enumeration>
                            </xs:restriction>
                          </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="indicatorCode" type="xs:string" use="optional">
                          <xs:annotation>
                            <xs:documentation xml:lang="ro">Codul indicatorului pe care se defalca valoarea  articolului</xs:documentation>
                          </xs:annotation>
                        </xs:attribute>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="noInvoice" use="required">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Numărul facturii</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                      <xs:restriction base="xs:string">
                        <xs:maxLength value="20" />
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:attribute>
                  <xs:attribute name="dateInvoice" type="xs:date" use="required">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Data facturii</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="totalValue" type="xs:double" use="required">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Valoarea totală a facturii</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="appID" type="xs:unsignedLong" use="required">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Identificatorul unic al înregistrării</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="ops" minOccurs="0">
          <xs:annotation>
            <xs:documentation xml:lang="ro">Listă borderouri de plată</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="op" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                  <xs:documentation xml:lang="ro">Borderou de plată</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                  <xs:attribute name="noOp" type="xs:unsignedLong" use="required">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Numărul borderoului de plată</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="dateOp" type="xs:date" use="required">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Data borderoului de plată</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="valueOp" type="xs:double" use="required">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Valoarea borderoului de plată</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="obs" type="xs:string" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Observaţii</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="appID" type="xs:unsignedLong" use="required">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Identificatorul unic al înregistrării</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="provider" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Denumirea furnizorului de servicii</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="fiscalCode" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Codul fiscal al furnizorului de servicii</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="contractNo" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Numărul de contract valabil la data raportării</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="insuranceHouse" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Casa de asigurări cu care are contract furnizorul</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="reportingDate" type="xs:date" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Data raportării</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="startFrom" type="xs:date" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Data de început a raportării</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="endTo" type="xs:date" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Data de sfârşit a raportării</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="contractYear" type="xs:unsignedInt" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Anul contractului</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="centralizerNo" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Numărul centralizatorului</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="appKey" type="xs:string" use="optional">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Cheia de identificare a aplicaţiei de raportare (producator de software 3rd partry)</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="appID" type="xs:unsignedLong" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Identificatorul unic al raportării</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="Nhp" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Numărul programului naţional de sănătate</xs:documentation>
        </xs:annotation>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
</xs:schema>